package gtgold;

import java.awt.*;
import javax.swing.*;

/**
 * Background GIF Image Panel
 * 
 * @author Isabelle
 */
public class gifImagePanel extends JPanel
{
	private static final long serialVersionUID = 1L;
	// private BufferedImage theBgImage;
	private Image image;

	/**
	 * Create the panel.
	 */
	public gifImagePanel(String filename)
	{

		try
		{
			image = Toolkit.getDefaultToolkit().createImage(filename);

		} catch (Exception e)
		{
			e.printStackTrace();
		}
		setLayout(new GridLayout(1, 1));
	}

	// overwrites default
	public void paintComponent(Graphics g)
	{

		super.paintComponent(g);
		if (image != null)
			g.drawImage(image, 0, 0, getWidth(), getHeight(), this);

	}
}
